﻿using System.Configuration;

namespace FileSynchronizer.Objects
{
    public class FileSynchronizerSettings : ApplicationSettingsBase
    {

        #region Public variables and properties
        //---------------------------------------------------------------------------------------------------------------------------------------

        [UserScopedSetting()]
        public bool RunMinimized
        {
            get
            {
                if (this["RunMinimized"] == null)
                {
                    this["RunMinimized"] = false;
                }
                return (bool)this["RunMinimized"];
            }
            set
            {
                this["RunMinimized"] = value;
            }
        }

        [UserScopedSetting()]
        public bool RunWhenUserLogsOn
        {
            get
            {
                if (this["RunWhenUserLogsOn"] == null)
                {
                    this["RunWhenUserLogsOn"] = false;
                }
                return (bool)this["RunWhenUserLogsOn"];
            }
            set
            {
                this["RunWhenUserLogsOn"] = value;
            }
        }

        [UserScopedSetting()]
        public bool SyncAtStartup
        {
            get
            {
                if (this["SyncAtStartup"] == null)
                {
                    this["SyncAtStartup"] = false;
                }

                return (bool)this["SyncAtStartup"];
            }
            set
            {
                this["SyncAtStartup"] = value;
            }
        }

        [UserScopedSetting()]
        public bool UseURLforMappedDrive
        {
            get
            {
                if (this["UseURLforMappedDrive"] == null)
                {
                    this["UseURLforMappedDrive"] = true;
                }
               
                return (bool)this["UseURLforMappedDrive"];
            }
            set
            {
                this["UseURLforMappedDrive"] = value;
            }
        }

        [UserScopedSetting()]
        public bool AutoTerminateApplication
        {
            get
            {
                if (this["AutoTerminateApplication"] == null)
                {
                    this["AutoTerminateApplication"] = false;
                }

                return (bool)this["AutoTerminateApplication"];
            }
            set
            {
                this["AutoTerminateApplication"] = value;
            }
        }

        [UserScopedSetting()]
        public bool DisableFolderWarning
        {
            get
            {
                if (this["DisableFolderWarning"] == null)
                {
                    this["DisableFolderWarning"] = false;
                }

                return (bool)this["DisableFolderWarning"];
            }
            set
            {
                this["DisableFolderWarning"] = value;
            }
        }


        [UserScopedSetting()]
        public int TerminationWaitTime
        {
            get
            {
                if (this["TerminationWaitTime"] == null)
                {
                    this["TerminationWaitTime"] = 60;
                }

                return (int)this["TerminationWaitTime"];
            }
            set
            {
                this["TerminationWaitTime"] = value;
            }
        }

        [UserScopedSetting()]
        public bool EnableEnterpriseFeatures
        {
            get
            {
                if (this["EnableEnterpriseFeatures"] == null)
                {
                    this["EnableEnterpriseFeatures"] = false;
                }
                return (bool)this["EnableEnterpriseFeatures"];
            }
            set
            {
                this["EnableEnterpriseFeatures"] = value;
            }
        }

        [UserScopedSetting()]
        public bool LatencyEnabled
        {
            get
            {
                if (this["LatencyEnabled"] == null)
                {
                    this["LatencyEnabled"] = false;
                }

                return (bool)this["LatencyEnabled"];
            }
            set
            {
                this["LatencyEnabled"] = value;
            }
        }


        [UserScopedSetting()]
        public int LatencyTimeout
        {
            get
            {
                if (this["LatencyTimeout"] == null)
                {
                    this["LatencyTimeout"] = 100;
                }

                return (int)this["LatencyTimeout"];
            }
            set
            {
                this["LatencyTimeout"] = value;
            }
        }


        //---------------------------------------------------------------------------------------------------------------------------------------
        #endregion

    }
}
